// 定义地址管理接口

import axios from "./axios"
// 定义地址列表接口
export function addresslist(data:{
    userid:string
}){
    return axios({
        method:'get',
        url:`/address/list`,
        params:data
    })
}

// 定义添加地址接口
export function addressadd(data:{
    userid:string,
    name:string,
    tel:string,
    province:string,
    city:string,
    county:string,
    addressDetail:string,
    isDefault:string,
}){
    return axios({
        method:'post',
        url:`/address/add`,
        data
    })
}
// 定义删除地址的接口
export function deleteaddress(data:{
    addressid:string,
}){
    return axios({
        method:'post',
        url:'/address/delete',
        data
    })
}
// 定义更新地址的接口
export function updateaddress(data:{
    addressid:string,
    userid:string,
    name:string,
    tel:string,
    province:string,
    city:string,
    county:string,
    addressDetail:string,
    isDefault:string,
}){
    return axios({
        method:'post',
        url:'/address/update',
        data
    })
}
// 定义查询默认地址的接口
export function defaultAddress(data:{
    userid:string,
}){
    return axios({
        method:'post',
        url:'/address/defaultAddress',
        data
    })
}

